<?
include('includes/db.class.php');
include('includes/settings.php');
include('includes/function.php');
include("includes/image.class.php");
include('localization/localization.class.php');

session_start();

$db = new DB(DB_NAME, DB_SERVER, DB_USER, DB_PWD);
$db->charset(DB_CHARSET);

// Nawattapon
$urix = explode("/", $_SERVER['PHP_SELF'] );
$uri = end($urix);
// Nawattapon

//$uri = end(explode("/", $_SERVER['PHP_SELF'] )) // error : Strict Standards: Only variables should be passed by reference 

if(!isset($_SESSION['did_init'])){
  $_SESSION['did_init'] = true;
  $_SESSION['language'] = "th";
}

// set language
// error : Notice: Undefined index: lang
if(isset($_GET['lang'])){
  $lang = $_GET['lang'];

  if($lang != null)
    $_SESSION['language'] = $lang;
}


$local = new Localization($_SESSION['language']);
?>